#include "commonutil.h"

CommonUtil::CommonUtil(QObject *parent) : QObject(parent)
{

}

CommonUtil::~CommonUtil()
{

}

bool CommonUtil::getCommandOutput(const QString cmd, QString &out)
{
    char name[200];
    FILE *fp1 = NULL;
    if ((fp1 = popen(cmd.toStdString().data(), "r")) == NULL)
        return false;
    memset(name, 0, sizeof(name));
    fgets(name, sizeof(name),fp1);
    pclose(fp1);
    out = QString(name);
    return true;
}

int CommonUtil::getPopWindowDelayTime()
{
    return 300;

    //return 6000;
}
